package t_1310

func xorQueries(arr []int, queries [][]int) []int {
	xOrs := make([]int, len(arr)+1)
	for i, v := range arr {
		xOrs[i+1] = xOrs[i] ^ v
	}
	ans := make([]int, len(queries))
	for i, q := range queries {
		ans[i] = xOrs[q[0]] ^ xOrs[q[1]+1]
	}
	return ans
}
